package com.hspedu.extends_.exercise;

import com.hspedu.modifier.A;

/**
 * @Author Stringzhua
 * @Date 2024/3/1 21:07
 * description:练习2
 */
public class ExtendsExercise02 {
    public static void main(String[] args) {
        C01 c = new C01();
    }
}
class A01{//A类
    public A01(){
        System.out.println("我是A类");
    }
}

class B01 extends A01 {
    public B01(){
        System.out.println("我是B类的无参构造");
    }
    public B01(String name){
        System.out.println(name+"我是B类的有参构造");
    }
}

class C01 extends B01{
    public C01(){
        this("hello");
        System.out.println("我是C类的无参构造");
    }
    public C01(String name){
        super("haha");
        System.out.println("我是C类的有参构造");
    }
}
